package concurrent;

import java.util.concurrent.CountDownLatch;

/**
 * @author sjw
 * @className JavaWaitGroup
 * @date 2021/7/21 18:09
 * @description: TODO
 */
public class JavaWaitGroup {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("2021-9".matches("[2-9][0-9]{3}-[0-9]{2}"));
        CountDownLatch countDownLatch=new CountDownLatch(2);
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程1");
                countDownLatch.countDown();
            }
        }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程2");
                countDownLatch.countDown();
            }
        }).start();
        System.out.println("wait");
        countDownLatch.await();
        System.out.println("main");
    }
}
